' This software and the accompanying files are provided "as is"
' and without warranties as to performance of the software and
' the accompanying files or any other warranties whether expressed
' or implied. No warranty of fitness for a particular purpose
' is offered.
'
' You may not sell this software or it's source code.
' You may use this code in any way you find useful.
Declare Function GetWindowsDirectory Lib "Kernel" (ByVal lpBuffer As String, ByVal nSize As Integer) As Integer
Declare Function GetPrivateProfileString Lib "Kernel" (ByVal lpApplication As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal FileStr As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
Global SongFileName As String 'File Name of the midi file
Global Index As Integer 'Element counter for SongTitleArrray()
Global CRLF As String 'Carriage Return and Line Feed
Global SongLength As String 'Variable for length of time of a song
' low level MIDI Functions
Declare Function MidiOutOpen Lib "mmsystem.dll" (hMidiOut As Long, ByVal DeviceId As Integer, ByVal C As Long, ByVal I As Long, ByVal F As Long) As Integer
Declare Function MidiOutShortMsg Lib "mmsystem.dll" (ByVal hMidiOut As Integer, ByVal MidiMessage As Long) As Integer
Declare Function MidiOutGetNumDevs Lib "mmsystem.dll" () As Integer
Declare Function MidiOutClose Lib "mmsystem.dll" (ByVal hMidiOut As Integer) As Integer
Declare Function MidiOutReset Lib "mmsystem.dll" (ByVal hMidiOut As Integer) As Integer
Global MidiEventOut, MidiNoteOut, MidiVelOut As Long
Global hMidiOut As Long
Global hMidiOutCopy As Long 'integer
'Global MidiOpenError As String
Global MidiOpenError As Integer
Global Const MIDI_MAPPER = -1
' The current Midi Channel out set on MidiPlayer form
Global MidiChannelOut As Integer
Function FileExists (FileName As String) As Integer
'This sub checks for the existance of any filename passed to it
If Len(Dir$(FileName)) Then
FileExists = True
Else
FileExists = False
End If
End Function
Sub MidiReset ()
'This sub will reset the midi sequencer
'These are not MCI commands, but deal directly with the device
'Open Midi Out while song is not playing
'hMidiOut is filled with a value upon successful completion